<template>
	<view class="navLayout">
		<view class="navbar">
			<view class="statusBar" :style="{height: getStatusBarHeight() + 'px'}"></view>
			<view class="titleBar" :style="{height: getTitleBarHeight() + 'px'}" @click="goSearch">
				<view class="title">{{title}}</view>
				<view class="search">
					<uni-icons type="search" color="#888" size="18" class="icon"></uni-icons>
					<text class="text">搜索</text>
				</view>
			</view>
		</view>
		<view class="fill" :style="{height: getFillHeight() + 'px'}"></view>
	</view>
</template>

<script setup>
import {getStatusBarHeight, getTitleBarHeight, getFillHeight} from '@/utils/system.js'

defineProps({
	title: {
		type: String,
		default: ''
	}
})

const goSearch = () => {
	uni.navigateTo({
		url:'/pages/search/search'
	})
}


</script>

<style lang="scss" scoped>
.navLayout{
	.navbar{
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		z-index: 10;
		
		background:
		linear-gradient(to bottom, rgba(0,0,0,0,), #fff 400rpx),
		linear-gradient(to right, #beecd8 20%, #F4E2D8);
		
		.statusBar{
			
		}
		.titleBar{
			padding: 0 30rpx;
			display: flex;
			justify-content: flex-start;
			align-items: center;
			.title{
				color: $text-color-mian;
				font-weight: 700;
				font-size: 22px;
				vertical-align: center;
			}
			.search{
				width: 220rpx;
				height: 50rpx;
				border-radius: 50rpx;
				background: rgba(255,255,255,0.4);
				border: 1px solid #fff;
				margin-left: 30rpx;
				color: #999;
				font-size: 28rpx;
				display: flex;
				align-items: center;
				padding: 4rpx 10rpx;
				.text{
					margin-left: 10rpx;
				}
			}
		}
	}
}
</style>